< previous page page_602 next page >

Page 602
Listing 15.3. continued
// display results
SELECT * FROM JobTitles;
SELECT * FROM JobReport;
// eof
0602-01.jpg
Figure 15.3.
The results of the 
INSERT INTO_FROM statement.
Note.gif
You might have noticed in Listing 15.3 that you created two indexes, each on an identical column name, but you gave the two indexes different names. SQL does not allow you to use the same name on different indexes, even if they refer to different tables. Indexes appear as independent data objects in a Microsoft Access database. Each object must have a unique name.

Notice that the INSERT INTO_FROM statement lists only those fields that are present in both tables. You need to list the columns by name in this example because the JobReport table does not contain all the fields that the JobTitles table contains. If both tables were an exact match, you could use the asterisk wildcard (*) character in the SELECT clause. For example, if JobTitles and JobReport shared all the same column names, you could use the following SQL statement to append data from one to the other:
INSERT INTO JobReport SELECT * FROM JobTitles;

 
< previous page page_602 next page >

If you like this book, buy it!